/*
package com.wanmait.gohome.aop;

import com.wanmait.gohome.pojo.Admin;
import com.wanmait.gohome.pojo.LogSheet;
import com.wanmait.gohome.service.LogSheetService;
import com.wanmait.gohome.util.SysContext;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

@Component
@Aspect
public class OperationLog {
    @Resource
    private LogSheetService logSheetService;


    @Pointcut("execution(* com.wanmait.gohome.service.*.*(..)) && !execution(* com.wanmait.gohome.service.LogSheetService.insert(..)) && !execution(* com.wanmait.gohome.service.LogSheetService.insert(..))")
    public void pointCutExpression() {
    }
    @AfterReturning(value = "pointCutExpression()",returning ="returnObj" )
    public void afterReturning(JoinPoint joinPoint, Object returnObj)
    {
        HttpSession session = SysContext.getSession();
        if (session!=null)
        {
            Admin admin    =(Admin)session.getAttribute("admin");
            if (admin!=null)
            {
                Integer id= admin.getId();
                String clazz=joinPoint.getTarget().getClass().getName(); //类名
                String method = joinPoint.getSignature().getName(); //方法名


                StringBuffer info = new StringBuffer();

                if(clazz=="com.wanmait.gohome.service.impl.UserinfoServiceImpl"&&method=="updateEnable")
                {
                    info.append("类：");
                    info.append("修改了用户的状态");
                    info.append(";方法：");
                    info.append("修改了用户的状态");

                    LogSheet logSheet=new LogSheet();
                    logSheet.setAdminId(id);
                    logSheet.setLog(info.toString());
                    logSheet.setLoginIp(SysContext.getRequest().getRemoteAddr());//ip
//                System.out.println(info.toString());

                    logSheetService.insert(logSheet);

                }
                if(clazz=="com.wanmait.gohome.service.impl.InformationServiceImpl"&&method=="updateStateNable")
                {
                    info.append("类：");
                    info.append("修改了遗失者信息的状态");

                    LogSheet logSheet=new LogSheet();
                    logSheet.setAdminId(id);
                    logSheet.setLog(info.toString());
                    logSheet.setLoginIp(SysContext.getRequest().getRemoteAddr());//ip
//                System.out.println(info.toString());

                    logSheetService.insert(logSheet);

                }
                if(clazz=="com.wanmait.gohome.service.impl.JournalServiceImpl"&&method=="updateEnable")
                {
                    info.append("类：");
                    info.append("修改了日志状态");

                    LogSheet logSheet=new LogSheet();
                    logSheet.setAdminId(id);
                    logSheet.setLog(info.toString());
                    logSheet.setLoginIp(SysContext.getRequest().getRemoteAddr());//ip
//                System.out.println(info.toString());

                    logSheetService.insert(logSheet);

                }
                if(clazz=="com.wanmait.gohome.service.impl.CommentServiceImpl"&&method=="updateEnable")
                {
                    info.append("类：");
                    info.append("修改了评论状态");

                    LogSheet logSheet=new LogSheet();
                    logSheet.setAdminId(id);
                    logSheet.setLog(info.toString());
                    logSheet.setLoginIp(SysContext.getRequest().getRemoteAddr());//ip
//                System.out.println(info.toString());

                    logSheetService.insert(logSheet);

                }
                if(clazz=="com.wanmait.gohome.service.impl.TaskServiceImpl"&&method=="deblocking")
                {
                    info.append("类：");
                    info.append("修改了通过状态");

                    LogSheet logSheet=new LogSheet();
                    logSheet.setAdminId(id);
                    logSheet.setLog(info.toString());
                    logSheet.setLoginIp(SysContext.getRequest().getRemoteAddr());//ip
//                System.out.println(info.toString());

                    logSheetService.insert(logSheet);

                }
                if(clazz=="com.wanmait.gohome.service.impl.TaskServiceImpl"&&method=="closure")
                {
                    info.append("类：");
                    info.append("修改了拒绝状态");

                    LogSheet logSheet=new LogSheet();
                    logSheet.setAdminId(id);
                    logSheet.setLog(info.toString());
                    logSheet.setLoginIp(SysContext.getRequest().getRemoteAddr());//ip
//                System.out.println(info.toString());

                    logSheetService.insert(logSheet);

                }
                if(clazz=="com.wanmait.gohome.service.impl.NewsServiceImpl"&&method=="add")
                {
                    info.append("类：");
                    info.append("添加了文章");

                    LogSheet logSheet=new LogSheet();
                    logSheet.setAdminId(id);
                    logSheet.setLog(info.toString());
                    logSheet.setLoginIp(SysContext.getRequest().getRemoteAddr());//ip
//                System.out.println(info.toString());

                    logSheetService.insert(logSheet);

                }





            }


        }

    }

}

*/
